package com.android.tea;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.android.tea.adapter.FavoritesAdapter;
import com.android.tea.entity.Favorites;

public class FavoritesActivity extends Activity implements OnClickListener {
	ListView footprintList;
	private Button btnBack;
	private TextView title_this;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.footprint);
		title_this = (TextView) findViewById(R.id.title_this);
		title_this.setText("我的收藏");
		footprintList = (ListView) findViewById(R.id.footprintLists);
		FavoritesAdapter adapter = new FavoritesAdapter(this, loadData());
		footprintList.setAdapter(adapter);
		btnBack = (Button) findViewById(R.id.btn_back);
		btnBack.setOnClickListener(this);
	}

	private List<Favorites> loadData() {
		List<Favorites> list = new ArrayList<Favorites>();
		Favorites member4 = new Favorites();
		member4.setFav_info("花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1");
		member4.setFav_price("￥150");
		list.add(member4);

		Favorites member = new Favorites();
		member.setFav_info("花相惜2花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1");
		member.setFav_price("￥520");
		list.add(member);

		Favorites member1 = new Favorites();
		member1.setFav_info("花相惜3花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1花相惜1");
		member1.setFav_price("￥3");
		list.add(member1);

		Favorites member2 = new Favorites();
		member2.setFav_info("花相惜4");
		member2.setFav_price("￥50.2");
		list.add(member2);

		Favorites member3 = new Favorites();
		member3.setFav_info("花相惜5");
		member3.setFav_price("￥30");
		list.add(member3);

		Favorites member5 = new Favorites();
		member5.setFav_info("花相惜6");
		member5.setFav_price("￥50");
		list.add(member5);

		return list;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_back:
			super.onBackPressed();
			break;

		default:
			break;

		}

	}
}
